from django.db import models

# Create your models here.
# python manage.py makemigrations
# python manage.py migrate

class Prod(models.Model):
    prod_id = models.AutoField(auto_created=True,primary_key=True)
    vend_id = models.IntegerField(null=True)
    prod_name = models.CharField(max_length=200)
    prod_price = models.DecimalField(max_digits=5,decimal_places=2)
    prod_desc = models.TextField()

    class Meta:
        db_table = "products"
    '''
    res = models.Prod.objects.filter().first()
    print(res):
    __str__函数功能：.5 ton anvil，不带显示：Prod: Prod object (ANV01)
    '''
    def __str__(self):
        return self.prod_name

    # 新增数量字段
    prod_count = models.IntegerField(default=35)